import axios from 'axios'

const instance = axios.create({
  baseURL: 'http://bos-api-dev.liangyihui.net/bos/csco/'
})

const postData = {
  'head': {
    'cid': 'TestData_CID',
    'auth2': '',
    'auth': 'YRG3bv7AKguNEAonXNoMAKaEL/EqIEAK/zx8k5U112s='
  }
}

export default {
  post: function (url, config, cb) {
    return new Promise(function (resolve, reject) {
      instance.post(url, Object.assign({}, postData, config))
        .then(function (response) {
          resolve(response.data)
        })
        .catch(function (error) {
          console.log(error)
        })
    })
  }
}
